Shader "Custom/InvertColorShader"
{
    Properties
    {
        _MainTex("Image", 2D) = "white" {}
    }
    SubShader
    {
        Pass
        {
            Tags { "Queue" = "Transparent" "RenderType" = "Transparent" }

            Blend One DstColor
            BlendOp Sub

            CGPROGRAM
            #pragma vertex vert
            #pragma fragment frag

            struct a2v
            {
                float4 pos: POSITION;
                float2 uv: TEXCOORD0;
                float4 color : COLOR;
            };

            struct v2f
            {
                float4 pos : SV_POSITION;
                float2 uv: TEXCOORD0;
                float4 color : COLOR;
            };

            sampler2D _MainTex;

            v2f vert(a2v i) 
            {
                v2f o;
                o.pos = UnityObjectToClipPos(i.pos);
                o.uv = i.uv;
                o.color = i.color;
                return o;
            }

            fixed4 frag(v2f i) : COLOR
            {
                fixed4 color = tex2D(_MainTex, i.uv) * i.color;
                clip(color.a - 0.01f);
                return color;
            }

            ENDCG
        }
    }
    FallBack "UI/Default"
}
